﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ClockAnimation : MonoBehaviour {
	private static ClockAnimation instance;
	public GameObject minuteDir;
	public GameObject hourDir;
	private float timer;

	private void Awake()
	{
		instance = this;
	}

	void Update () {
		if (!TimeSlider.IsCanPlay || !GameManager.IsPlaying||GameStatistic.GameScore<1)
			return;
		minuteDir.transform.Rotate (Vector3.forward * -5/2);
		timer += 0.02f;
		if (timer >= 1.2f) {
			timer = 0;
			hourDir.transform.Rotate (Vector3.forward * -5);
		}
	}


	public static void Reset()
	{
		instance.minuteDir.transform.eulerAngles = Vector3.zero;
		instance.hourDir.transform.eulerAngles = Vector3.zero;
	}
}
